<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<script src="../js/vue.min.js"></script>
		<script src="../js/vant.min.js"></script>
		<link rel="stylesheet" href="../css/index.css" />
		<script src="html5plus://ready"></script>
		<script src="../js/listener_other.js"></script>
		<script src="../js/ajax.js"></script>
		<script src="../js/vue-lazyload.js"></script>
		<title>我的收藏</title>
	</head>
	<body >
		<div id="app">
			<van-nav-bar title="我的收藏" left-arrow @click-left="click">
			</van-nav-bar>
			<van-badge-group>
				<van-badge title="收藏列表" />
			</van-badge-group>
			<van-row v-for="good in Goods">
				<div @click="goodsId(good.GoodsId)">
					<van-card
					  :num="good.SaleCount"
					  :price="good.RealPrice"
					  :title="good.GoodsName"
					  :origin-price="good.MarketPrice"
					   lazy-load="true"
					  :thumb="good.GoodsImageUrl"  >
					</van-card>
				</div>
			</van-row>
		</div>
		<script>
			Vue.use(VueLazyload, {
				error: "../img/yjz.jpg"
			});
			var vm = new Vue({
				el:"#app",
				data:{
					checked:false,
					key:"",
					Goods:""
				},
				methods:{
					click:function(){
						plus.webview.close(plus.webview.currentWebview().id)
					},
					goodsId:function(id) {
						 plus.webview.create("../shopknow/guym.html", "guym", {}, {
									shopId: id
								}).show(); 
							
						},
				},
				mounted:function(){
					var _this=this;
					if (localStorage.getItem("key") != null) {
						_this.Key = localStorage.getItem("key");
					}
					ajax({
						url:"http://dsapi.ysd3g.com/api/MyGoodsCollectList",
						dataType:"jsonp",
						data:{
							p:1,
							key:_this.Key
						},
						success:function(res){
							
							if(res.Error==false){
								_this.Goods=res.Data
							}else{
								_this.$toast.fail(res.Msg)
							}
						}
					})
				}
			})
		</script>
	</body>
</html>